package edu.sctu.alex.May.day20150525;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * Created by user03 on 2015/5/25.
 */
public class DayClient {

    public static void main(String[] args) {

        //map的一些基本用法
        Map<String,String> map = new HashMap<String,String>();
        map.put("小明","数据结构");
        map.put("小红","大学计算机");
        map.put("小张","c语言");
        map.put("小王","java web");
        map.put("小旭","bootstrap");

        String m = map.get("小明");
        System.out.println(m);
        //使用for循环进行遍历
        for(Map.Entry<String, String> entry:map.entrySet()){
            System.out.println(entry.getKey()+"--->"+entry.getValue());
        }
         //使用迭代进行遍历
        Set set = map.entrySet();

        Iterator i = set.iterator();
        while(i.hasNext()){
            Map.Entry<String, String> entry1=(Map.Entry<String, String>)i.next();
            System.out.println(entry1.getKey()+"=="+entry1.getValue());
        }

        //list 的一些基本用法


        Person p1 = new Person();
        p1.setName("alex");
        p1.setAge(18);
        p1.setSex("male");


    }
}
